package org.maggioni.springsandbox.rehearsals.e02annotation.e02jsr250;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;

import org.maggioni.springsandbox.model.decorators.Showable;
import org.maggioni.springsandbox.model.draw.Point;


public class MyBean extends Showable {
	
	private Point point;
	private Point point2;

	
	public Point getPoint() {
		return point;
	}

	@Resource
	public void setPoint(Point point) {
		this.point = point;
	}

	
	
	@Override
	public String toString() {
		return "MyBean [point=" + point + ", point2=" + point2 + "]";
	}

	@PostConstruct
	public void initializeMyBean() {
		System.out.println("Init of myBean");
	}
	
	@PreDestroy
	public void destroyMyBean() {
		System.out.println("Destroy of myBean");
	}

	@Resource(name="thePoint")
	public void setPoint2(Point point2) {
		this.point2 = point2;
	}

	public Point getPoint2() {
		return point2;
	}
	
	

}
